import { h, defineComponent, toRefs } from "@vue/runtime-core";
import bulletImg from "../../assets/rocket.png";
import { planeWidth } from "../utils/gameConfig";
export default defineComponent({
	props: ["x", "y"],
	setup(props, ctx) {
		// 方案二 使用 toRefs() 将 props 对象转为响应式对象
		const { x, y } = toRefs(props);
		return {
			x: x.value + planeWidth / 2,
			y
		}
	},
	render(ctx) {
		// DOM
		// <div><img src="imgPath" /></div>
		// pixi
		// <container><sprite texture="imgPath"></sprite></container>
		return h("Container", { x: ctx.x, y: ctx.y }, [h("Sprite", { texture: bulletImg })])
	}
})